package com.chang.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/*
 * @Author Changzhenxi
 * @Date 2024/8/6 11:01
 * @Description This is description of method
 */
@Configuration
public class MyRedissonConfig {


    @Bean(destroyMethod = "shutdown")
    public RedissonClient redisson() {
        //1、创建单节点配置
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.199.131:6379");
        return Redisson.create(config);
    }

}
